// 引入 request 文件
import request from '@/api/request'

// 更新用户经纬度
export const updatePosition = (data) => {
	return request({
		url: 'mine/updatePosition',
		method: 'post',
		data: data
	})
}

// 首页轮播图
export const bannerList = (data) => {
	return request({
		url: 'banner/list',
		method: 'get',
		data: data,
		query: true
	})
}

//系统广告
export const noticeList = (data) => {
	return request({
		url: 'notice/page',
		method: 'get',
		data: data,
		query: true
	})
}

//获取广告详情
export const noticeone = (data) => {
	return request({
		url: 'notice/get',
		method: 'get',
		data: data,
		query: true
	})
}

//签到
export const signIn = (data) => {
	return request({
		url: 'user/signIn',
		method: 'post',
		data: data,
		query: true
	})
}

// 获取分类
export const categoryList = (data) => {
	return request({
		url: 'category/list',
		method: 'get',
		data: data,
	})
}

// 获取商品系列
export const getseriesList = (data) => {
	return request({
		url: 'series/listByUser',
		method: 'get',
		data: data,
	})
}

// 获取商品
export const getproductList = (data) => {
	return request({
		url: 'product/pageByUser',
		method: 'get',
		data: data,
		query: true
	})
}

//获取一个商品
export const ProductById = (data) => {
	return request({
		url: 'product/get',
		method: 'get',
		data: data,
		query: true
	})
}

//猜你喜欢
export const guessYourLike = (data) => {
	return request({
		url: 'product/guessYourLike',
		method: 'get',
		data: data,
		query: true
	})
}

//获取优惠卷列表
export const getCouponList = (data) => {
	return request({
		url: 'coupon/listByUser',
		method: 'get',
		data: data,
		query: true
	})
}

//用户获得优惠卷
export const fetchCoupon = (data) => {
	return request({
		url: 'userCoupon/receive',
		method: 'post',
		data: data
	})
}

//查看用户优惠卷
export const getuserCouponlist = (data) => {
	return request({
		url: 'userCoupon/list',
		method: 'get',
		data: data,
		query: true
	})
}

// 搜索记录
export const searchRecordList = (data) => {
	return request({
		url: '/search/records',
		method: 'get',
		data: data,
	})
}

//搜索
export const Search = (data) => {
	return request({
		url: 'product/search',
		method: 'get',
		data: data,
	})
}

// 删除搜索记录
export const removeSearchRecord = (data) => {
	return request({
		url: 'search/delete',
		method: 'post',
		data: data,
		query: true
	})
}

//我的页面相关

//查看用户地址
export const getAddres = (data) => {
	return request({
		url: 'address/list',
		method: 'get',
		data: data,
		query: true
	})
}

//添加地址
export const addAddres = (data) => {
	return request({
		url: 'address/add',
		method: 'post',
		data: data
	})
}

//修改地址
export const updateAddres = (data) => {
	return request({
		url: 'address/update',
		method: 'post',
		data: data
	})
}

//删除地址
export const removeAddres = (data) => {
	return request({
		url: 'address/delete',
		method: 'post',
		data: data,
		query: true
	})
}

//获取用户默认地址
export const getDefaultAddress = (data) => {
	return request({
		url: 'address/getDefault',
		method: 'get',
		data: data,
		query: true
	})
}

//获取优惠卷
export const getCoupon = (data) => {
	return request({
		url: 'userCoupon/list',
		method: 'get',
		data: data,
		query: true
	})
}

//充值
export const recharge = (data) => {
	return request({
		url: 'recharge/recharge',
		method: 'post',
		data: data
	})
}

// 获取配置信息
export const systemConfig = (data) => {
	return request({
		url: '/systemConfig/queryByKey',
		method: 'get',
		data: data
	})
}

//获取vip 列表
// vip信息
export const vipList = (data) => {
	return request({
		url: 'vip/list',
		method: 'get',
		data: data
	})
}

// 获取套餐
export const seleTvp = (data) => {
	return request({
		url: 'tUserVipEquities/seleTvp',
		method: 'get',
	})
}

// 积分列表
export const pointRecord = (data) => {
	return request({
		url: '/pointRecord/list',
		method: 'get',
		data: data,
		updata: true
	})
}

// 余额列表
export const balanceList = (data) => {
	return request({
		url: 'balance/list',
		method: 'get',
		data: data
	})
}

// 余额明细
export const priceRecordList = (data) => {
	return request({
		url: 'priceRecord/page',
		method: 'get',
		data: data,
		query: true
	})
}

//体现
export const postpayouts = (data) => {
	return request({
		url: 'payouts/add',
		method: 'post',
		data: data,
		updata: true,
		query: true
	})
}

//体现记录
export const payoutsList = (data) => {
	return request({
		url: 'payouts/page',
		method: 'get',
		data: data,
		query: true
	})
}

//积分明细
export const pointRecordlist = (data) => {
	return request({
		url: 'pointRecord/page',
		method: 'get',
		data: data,
		query: true
	})
}

//抽奖模块
export const rewardlist = (data) => {
	return request({
		url: 'reward/list',
		method: 'get',
		data: data,
		// query:true
	})
}

//抽奖接口
export const postreward = (data) => {
	return request({
		url: 'reward/draw',
		method: 'post',
		data: data,
		query: true,
		updata: true
	})
}

//获取抽奖历史
export const userRewardlist = (data) => {
	return request({
		url: 'userReward/page',
		method: 'get',
		data: data,
		query: true
	})
}

//中奖名单
export const rewardslist = (data) => {
	return request({
		url: 'userReward/rewards',
		method: 'get',
		data: data,
	})
}

// 商品列表
export const productList = (data) => {
	return request({
		url: 'product/page',
		method: 'get',
		data: data,
		query: true
	})
}

//查看商品评论
export const getcommentList = (data) => {
	return request({
		url: 'comment/page',
		method: 'get',
		data: data,
		query: true
	})
}

//获取评论列表（支持商品评论和订单评论）
export const getCommentList = (data) => {
	return request({
		url: 'comment/page',
		method: 'get',
		data: data,
		query: true
	})
}

export const getproductone = (data) => {
	return request({
		url: 'product/get',
		method: 'get',
		data: data,
		query: true
	})
}

// 商品详情-下单
export const userPlacesAnOrder = (data) => {
	return request({
		url: 'tOrder/userPlacesAnOrder',
		method: 'post',
		data: data,
		updata: true
	})
}

//申请售后
export const applyafterSale = (data) => {
	return request({
		url: 'afterSale/apply',
		method: 'post',
		data: data
	})
}

//取消售后
export const cancelafterSale = (data) => {
	return request({
		url: 'afterSale/cancel',
		method: 'post',
		data: data,
		query: true
	})
}

//寄回商品
export const expressafterSale = (data) => {
	return request({
		url: 'afterSale/express',
		method: 'post',
		data: data,
		query: true
	})
}

// 购物车下单
export const userShoppingCartOrder = (data) => {
	return request({
		url: 'tOrder/userShoppingCartOrder',
		method: 'post',
		data: data,
		updata: true
	})
}

// 推荐商品
export const recommend = (data) => {
	return request({
		url: 'category/recommend',
		method: 'get',
		data: data
	})
}

//新增作品
export const addvideo = (data) => {
	return request({
		url: 'video/add',
		method: 'post',
		data: data
	})
}

//获取我的作品
export const getselfPage = (data) => {
	return request({
		url: '/video/selfPage',
		method: 'get',
		data: data,
		query: true
	})
}

//查询关注的用户
export const getlikeUsers = (data) => {
	return request({
		url: 'userLike/likeUsers',
		method: 'get',
		data: data,
		query: true
	})
}

export const getlikeVideos = (data) => {
	return request({
		url: 'userLike/likeVideos',
		method: 'get',
		data: data,
		query: true
	})
}

//获取短视频
export const getVideoslist = (data) => {
	return request({
		url: 'video/page',
		method: 'get',
		data: data,
		query: true
	})
}

//删除短视频
export const deleteVideo = (data) => {
	return request({
		url: 'video/delete',
		method: 'post',
		data: data,
		query: true
	})
}

//点赞
export const uservideofunction = (data) => {
	return request({
		url: 'userLike/add',
		method: 'post',
		data: data
	})
}

//直推
export const getDirectlist = (data) => {
	return request({
		url: 'user/direct',
		method: 'get',
		data: data,
		query: true,
		updata: true
	})
}

//扶持用户
export const getHelplist = (data) => {
	return request({
		url: 'user/help',
		method: 'get',
		data: data,
		query: true
	})
}

//查询用户下级
export const getSonslist = (data) => {
	return request({
		url: 'user/sons',
		method: 'get',
		data: data,
		query: true
	})
}

//排行榜
export const getrankinglist = (data) => {
	return request({
		url: 'user/ranking',
		method: 'get',
		data: data,
		query: true
	})
}

//申请公司到访
export const postvisit = (data) => {
	return request({
		url: 'visit/add',
		method: 'post',
		data: data
	})
}

//公司访问分页查询
export const getvisitlist = (data) => {
	return request({
		url: 'visit/page',
		method: 'get',
		data: data,
		query: true
	})
}

//获取公司访问详情
export const getvisitone = (data) => {
	return request({
		url: 'visit/get',
		method: 'get',
		data: data,
		query: true
	})
}

export const postfeedback = (data) => {
	return request({
		url: 'feedback/add',
		method: 'post',
		data: data
	})
}

//获取素材库
export const getimageslist = (data) => {
	return request({
		url: 'images/page',
		method: 'get',
		data: data,
		query: true
	})
}

//查询股东分红
export const getpriceRecordlist = (data) => {
	return request({
		url: 'priceRecord/dividend',
		method: 'get',
		data: data,
		query: true
	})
}

//获取股东收益
export const getpriceRecord = (data) => {
	return request({
		url: 'priceRecord/dividendPrice',
		method: 'get',
		data: data,
		query: true
	})
}

//购买会员
export const rechargeadd = (data) => {
	return request({
		url: 'recharge/add',
		method: 'post',
		data: data,
		query: true
	})
}










